-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
ALTER PROCEDURE AddEmployee
	-- Add the parameters for the stored procedure here
	@id numeric(8,0),
	@no nvarchar(50),
	@orgNo nvarchar(50),
	@timNo numeric(3,0),
	@lasName nvarchar(50),
	@firName nvarchar(50),
	@expFrom numeric(8,0),
	@expTo numeric(8,0),
	@pasWord nvarchar(50),
	@datOfBirth numeric(8,0),
	@idCard nvarchar(50),
	@homPhone nvarchar(50),
	@celPhone nvarchar(50),
	@regAddress nvarchar(100),
	@curAddress nvarchar(100),
	@email nvarchar(50),
	@marStatus numeric(1,0),
	@expTimFrom numeric(8,0),
	@expTimTo numeric(8,0),
	@gender numeric(1,0)
	
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	INSERT INTO EMPLOYEE(ID,EMPLOYEE_NO, ORGANIZATIONAL_NO, TIME_TABLE_NO, LAST_NAME, FIRST_NAME,
						 EXPIRATION_FROM, EXPIRATION_TO, LOGIN_PASSWORD, DAY_OF_BIRTH, ID_CARD,
						 HOME_PHONE, CELL_PHONE, REGISTRATION_ADDRESS, CURRENT_ADDRESS, EMAIL,
						 MARITAL_STATUS, EXPIRATION_FROM_TIME_TABLE, EXPIRATION_TO_TIME_TABLE, [STATUS], 
						 CREATE_DATE_TIME, UPDATE_DATE_TIME, GENDER) 
			VALUES (@id, @no, @orgNo, @timNo, @lasName, @firName, @expFrom, @expTo, @pasWord, @datOfBirth,
					@idCard, @homPhone, @celPhone, @regAddress, @curAddress, @email, @marStatus, @expTimFrom,
					@expTimTo, 0, GETDATE(), GETDATE(), @gender)
								 
END
GO
